<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ include file='../share_header.jsp' %>
<var id="customerInfo" style="display: none">${customerInfo}</var>

<div id="content-header" id="m-customerTitle">
    <h1>编辑客户信息</h1>
</div>

<%--<div id="breadcrumb" id="m-customerBreadcrumb">--%>
<%--&lt;%&ndash;<a href="index.html" class="tip-bottom" data-original-title="Go to Home"><i class="icon-home"></i> Home</a>&ndash;%&gt;--%>
<%--<a href="javascript:void(0)"--%>
<%--url="${pageContext.request.contextPath}/crm/getMyselfClientInfo.do"  class="m-pageChange tip-bottom">客户信息管理</a>--%>
<%--<a href="javascript:void(0)" class="m-pageChange"--%>
<%--url="${pageContext.request.contextPath}/crm/passwordModification.do" class="tip-bottom">我的客户</a>--%>
<%--<a href="#" class="current">编辑客户信息</a>--%>
<%--</div>--%>
<div class="container-fluid marginTop20">
    <%@ include file='share_edit_add_customer.jsp' %>
    <div id="saveCustomerFormButtons" class="row-fluid">
        <div class="form-actions offset2 span7">
            <div class="pull-right">
                <button type="submit" id="modifySaveBtn" class="btn btn-primary" style="width: 100px">修改</button>
                <button type="button" class="btn" id="cancelBtn">取消</button>
            </div>
        </div>
    </div>

    </fieldset>
    </form>
</div>
<script>
    $(function () {
        var result = $("#customerInfo").text();
        var jsonData = $.parseJSON(result);
        loadData(jsonData.list[0]);

        $("#customerForm").submit(function () {
            if ($("#customerForm").valid()) {
                var url = "";
                var postData = $("#customerForm").serialize();
                postAjax(url, postData, saveSuccess);
            }
        });
        var saveSuccess = function () {
            getPage("${pageContext.request.contextPath}/crm/getMyselfClientInfo.do");
        };
        $("#cancelBtn").click(function () {
            getPage("${pageContext.request.contextPath}/crm/getMyselfClientInfo.do");
        });
    });
</script>